Data mining is the exploration and analysis of large quantities of data, in order to discover correlations, patterns, and trends in the data. Data mining may also be used to create models that can be used to predict future data or classify existing data.
For example, a business may amass a large collection of information about its customers. This information may include purchasing information and any other information available to the business about the customer. The predictions of a model associated with customer data may be used, for example, to control customer attrition, to perform credit-risk management, to detect fraud, or to make decisions on marketing.
To create and test a data mining model such as a decision tree, available data may be divided into two parts. One part, the training data set, may be used to create models. The rest of the data, the testing data set, may be used to test the model, and thereby determine the performance of the model in making predictions. Data within data sets is grouped into cases. For example, with customer data, each case corresponds to a different customer. All data in the case describes or is otherwise associated with that customer.
One type of predictive model is the decision tree. Decision trees are used to classify cases with specified input attributes in terms of an output attribute. Once a decision tree is created, it can be used predict the output attribute of a given case based on the input attributes of that case.
Decisions trees are composed of nodes and leaves. One node is the root node. Each node has an associated attribute test that splits cases that reach that node to one of the children of the node based on an input attribute. The tree can be used to predict a new case by starting at the root node and tracing a path down the tree to a leaf, using the input attributes of the new case in the attribute tests in each node. The path taken by a case corresponds to a conjunction of attribute tests in the nodes. The leaf contains the decision tree's prediction for the output attribute(s) based on the input attributes.
An exemplary decision tree is shown in FIG. 1. In this decision tree, or example, if a decision tree is being used to predict a customer's credit risk, input attributes may include debt level, employment, and age, and the output attribute is a prediction of what the credit risk for the customer is. As shown in FIG. 1, decision tree 200 consists of root node 210, node 212, and leaves 220, 222 and 224. The input attributes are debt level and type of employment, and the output attribute is credit risk. Each node has associated with it a split constraint based on one of the input attributes. For example, the split constraint of root node 210 is whether debt level is high or low. Cases where the value of the debt input attribute is “high” will be transferred to leaf 224 and all other cases will be transferred to node 212. Because leaf 224 is a leaf, it gives the prediction the decision tree model will give if a case reaches leaf 224. For decision tree 200, all cases with a “high” value for the debt input attribute will have credit risk output attribute assigned to “bad” with a 100% probability. The decision tree 200 in FIG. 1 predicts only one output attribute, however more than one output attribute may be predicted with a single decision tree.
While the decision tree may be displayed and stored in a decision tree data structure, it may also be stored in other ways, for example, as a set of rules, one for each leaf node, containing a conjunction of the attribute tests.
Input attributes and output attributes do not have to be binary attributes, with two possible states. Attributes can have many states. In some decision tree creation contexts, attribute tests must be binary. Binary attribute tests divide data into two groups—one group of data that meets a specific test, and one group of data that does not. Therefore for an attribute with many states (e.g. a color variable with possible states {red, green, blue, violet}) a binary attribute test must be based on the selection of one of the states. Such an attribute test may therefore ask whether, for input attribute color, is the value of that attribute the state “red” and data at the node will be split into data for which the value of the attribute is “red” in one child, and data for which the value of the attribute is not “red” in another child.
In order to create the tree, the nodes, attribute tests, and leaf values must be decided upon. Generally, creating a tree is an inductive process. Given an existing tree, all testing data is processed by the tree, starting with the root node, divided according to the attribute test to nodes below, until a leaf is reached. The data at each leaf is then examined to determine whether and how a split should be performed, creating a node with an attribute test leading to two leaf nodes in place of the leaf node. This is done until the data at each node is sufficiently homogenous. In order to begin the induction the root node is treated as a leaf.
To determine whether a split should be performed, a score gain is calculated for each possible attribute test that might be assigned to the node. This score gain corresponds to the usefulness of using that attribute test to split the data at that node. There are many ways to determine which attribute test to use using the score gain. For example, the decision tree may be built by using the attribute test that reduces the amount of entropy at the node. Entropy is a measure of the homogeneity of the data. The data at the node must be split into two groups of data which each are heterogeneous from each other based on the output attribute for which the tree is being generated.
In order to determine what the usefulness is of splitting the data at the node with a specific attribute test, the resultant split of the data at the node for each output attribute must be computed. This correlation data is used to determine a score which is used to select an attribute test for the node. Where the input attribute being considered is gender, for example, and the output attribute is car color, the data from the following Table 1 must be computed for the testing data that reaches the node being split:
TABLE 1Correlation Count Tablegender = MALEgender ≠ MALEcar color = RED359503car color ≠ RED49033210
As described above, data in a correlation count table such as that shown in Table 1 must be calculated for each combination of a possible input attribute test and output attribute description. Because of the multiplicity of correlation count table calculations required, the more attributes considered, the higher the requirements in memory space and processing time to calculate these correlation count tables. One way of handling this problem is to select certain features to be used for input and output attributes. In the prior art, where this is done at all, it is done by selecting the input attributes with highest entropy for use in the decision tree. However, this yields poor results in terms of quality of prediction. Output attribute selection was only done by use of a user-supplied hierarchy, which yields no definite prediction quality gains and, indeed, often creates a worse prediction quality, since grouping attributes with different behavior negatively affects decision tree quality.
Thus, there is a need for a technique to allow the selection of output attributes and input attributes in such a way as to narrow the number of attributes used in training the decision tree while simultaneously selecting attributes for use which yield efficient and useful decision trees.